<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:s="http://jboss.com/products/seam/taglib">
      <body>
          <h:form>
             <a4j:include viewId="toolBar.xhtml"/>
             <br/>
             <rich:panel>
                 <f:facet name="header" >
                  User Profile
                 </f:facet>
                 <f:facet name="beforeInvalidField">
                   
                 </f:facet>
                 <f:facet name="aroundInvalidField">
                   <s:div style="display:block;"/>
                 </f:facet>
                 <f:facet name="afterInvalidField">
                   
                   <s:message style="font-size:12px;color:red"/>
                    
                 </f:facet>
                 <s:div id="userProf">
                <table align="center" width="100%" style="font-size:12px" >
                     <tr>
                         <td>
                             #{messages['fina2.login.loginButton']}
                         </td>
                         <td style="color:red">
                        
                         </td>
                         <td>
                             
                                 <h:inputText disabled="true" id="userId"  value="#{userSession.currentUser.login}" />
                                 
                                 
                             
                         </td>
                        
                     </tr>
                     <tr>
                         <td>User Name:</td>
                         <td style="color:red">
                         *
                         </td>
                         <td>
                             <s:decorate>
                                 <h:inputText validator="#{userValidator.validateText}" value="#{userSession.currentUser.name}" required="true" requiredMessage="User Name is required">
                                     <s:validate/>
                                 </h:inputText>
                             </s:decorate>
                         </td>
                     </tr>
                     <tr>
                         <td>Title:</td>
                        <td style="color:red">
                         
                         </td>
                         <td><h:inputText value="#{userSession.currentUser.title}" /></td>
                     </tr>
                     <tr>
                         <td>Password:</td>
                         <td style="color:red">
                         *
                         </td>
                         <td>
                             <s:decorate>
                                 <h:inputSecret redisplay="false" validator="#{userValidator.validatePassword}" id="pwd" value="#{userSession.currentUser.password}" required="true"  requiredMessage="Password is required">
                                     <s:validate/>
                                 </h:inputSecret>
                             </s:decorate>
                         </td>
                     </tr>
                     <tr>
                         <td>Confirm:</td>
                         <td style="color:red">
                         *
                         </td>
                         <td>
                             <s:decorate>
                                <h:inputSecret redisplay="false" validator="#{userValidator.validateConfirmPassword}" value="#{userSession.currentUser.confirm}" required="true" requiredMessage="Confirmation is required">
                                    <s:validate />
                                </h:inputSecret>
                             </s:decorate>
                         </td>
                     </tr>
                     
                     <tr>
                         <td>Phone:</td>
                        <td style="color:red">
                         
                         </td>
                         <td><h:inputText value="#{userSession.currentUser.phone}" /></td>
                     </tr>
                     <tr>
                         <td>Email:</td>
                         <td style="color:red">
                         
                         </td>
                         <td><h:inputText value="#{userSession.currentUser.email}" /></td>
                     </tr>
                 </table>
                 </s:div>
                 <table align="center">
                     <tr>
                         <td><a4j:commandButton onclick="Richfaces.showModalPanel('loading')" oncomplete="Richfaces.hideModalPanel('loading')" action="#{userSession.updateCurrentUser()}" reRender="userProf,pwd" value="Submit Changes" style="width:120px">
                              
                             </a4j:commandButton>
                         </td>                         
                     </tr>
                 </table>
             </rich:panel>
             
            
          </h:form>
      </body>
</html>